<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/common/initiate.jsp" %>
<html>
	<head>
		<style type="text/css">
		    .main,.aside {padding:5px 0 0 0;}
			.main{float:left; width:600px; padding-right:40px; word-wrap:break-word;}
		    .wrapper{width:950px; margin-left:auto; margin-right:auto;min-height:400px;}
		    .basic-input { width: 200px; padding: 5px; height: 13px; font-size: 14px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; border: 1px solid #c9c9c9 }
			label { display: inline-block; float:left; margin-right: 15px; text-align: right; width: 80px; font-size: 14px; line-height: 30px; vertical-align: baseline }
			.error {color: #FE2617; border:0px; background:#fff;padding:0px;margin:0px;}
		</style>
		<script>
			function trim(str){ //删除左右两端的空格
			　　 return str.replace(/(^\s*)|(\s*$)/g, "");
			}
			/**
			 * 验证用户名密码
			 */
			function validate(){
				var userName = document.getElementById("userName").value;
				var password = document.getElementById("password").value;
				if( trim(userName) == "") {
					alert("用户名不能为空");
					return false;
				}else if( trim(password) == "" ){
					alert("密码不能为空");
					return false;
				}
			}
		</script>
	</head>
	<body>
		<div class="wrapper">
			<h1>系统登录</h1>
			<div class="main">
				<form action="${ctx }/login.do" method="post" onsubmit="return validate()">
					<input type="hidden" value="${destUrl}" name="destUrl" id="destUrl" />
					<table width="600" border="0" align="center">
					  <tr>
					    <td colspan="2" height="30px"  align="center" bgcolor="#424142"><strong>会员登录</strong></td>
					  </tr>
					  <tr>
					    <td align="right" width="40%">用户名:</td>
					    <td><input type="text" tabindex="1" value="${userId}" maxlength="60" class="basic-input" name="userId" id="userId" /></td>
					  </tr>
					  <tr>
					    <td align="right" width="40%">密码:</td>
					    <td><input type="password" tabindex="2" maxlength="20" class="basic-input" name="password" id="password" /></td>
					  </tr>
					  <tr>
					    <td colspan="2" align="center">
					      <input type="submit" value="提交">&nbsp;&nbsp;&nbsp;
					      <input type="reset"  value="重置">
					    </td>
					  </tr>
					  <tr>
					    <td colspan="2" height="30px" align="center">
					    	 <c:if test="${ ! empty LOGIN_ERROR}">
						    	<div class="item-error">
						    		<label>&nbsp;</label>
						    		<p class="error">${LOGIN_ERROR}</p>
						    	</div>
						    </c:if>
					    </td>
					  </tr>
					  <tr>
					    <td colspan="2" height="30px" align="center" bgcolor="#424142"></td>
					  </tr>
					</table>
				</form>
			</div>
		</div>
	</body>
</html>
